package com.sip.stream.utils.zfy.status;

import android.util.Log;

import com.sip.stream.utils.zfy.ZFYLocation;

import java.util.concurrent.atomic.AtomicBoolean;

public class ZFYStatus {
    private static final String TAG = "ZFYStatus";

    private static ZFYStatus instance;

    private ZFYLocation location;
    private boolean gpsReady = false;
    private boolean bdOnly = false;
    private int batteryLevel = -1;
    private boolean batteryin = true;
    private boolean isLowTemperatureMode = false;
    private boolean isHeightTemperatureMode = false;
    private boolean powerconnected = false;
    private boolean openBle = false;
    private boolean usbconnect = false;
    private int airplaneState = 0;
    private int wifiSignalLevel = -1;
    private int wifiVersion = 0;
    private int mobileNetworkType = -1;
    private String mobileNetworkStr = "";
    private AtomicBoolean lockSetMSDC = new AtomicBoolean(false);
    private boolean usbMassStorage = false;
    private boolean isLocked = false;
    private boolean deviceLocked = true;
    private int mobileSignalStrength = 0;
    private boolean isSilent = false;
    private boolean isUVCCameraIn = false;
    private boolean storageAbnormal = false;
    private boolean screenOn = true;
    private boolean longWorkMode = false;
    private float emptyGbSize = 0.0f;
    private int permission = 0;


    public static ZFYStatus getInstance() {
        if (instance == null) {
            synchronized (ZFYStatus.class) {
                if (instance == null) {
                    instance = new ZFYStatus();
                }
            }
        }
        return instance;
    }

    public void setLockSetMSDC(boolean lockSetMSDC) {
        Log.i(TAG, "setLockSetMSDC: " + lockSetMSDC);
        this.lockSetMSDC.set(lockSetMSDC);
    }

    public boolean isLockSetMSDC() {
        return this.lockSetMSDC.get();
    }


    public double getLongitude() {
        ZFYLocation zFYLocation = this.location;
        if (zFYLocation != null) {
            return zFYLocation.getLongitude();
        }
        return 0.0d;
    }

    public double getLatitude() {
        ZFYLocation zFYLocation = this.location;
        if (zFYLocation != null) {
            return zFYLocation.getLatitude();
        }
        return 0.0d;
    }

    public void setLocation(ZFYLocation location) {
        this.location = location;
    }

    public ZFYLocation getLocation() {
        ZFYLocation zFYLocation = this.location;
        return zFYLocation != null ? zFYLocation : new ZFYLocation();
    }

    public void setPowerconnected(boolean powerconnected) {
        if (this.powerconnected != powerconnected) {
            this.powerconnected = powerconnected;
        }
    }

    public boolean isPowerconnected() {
        return this.powerconnected;
    }

    public boolean isBatteryin() {
        return this.batteryin;
    }

    public int getPermission() {
        return this.permission;
    }

    public void setPermission(int permission) {
        this.permission = permission;
    }

    public int getBatteryLevel() {
        return this.batteryLevel;
    }

    public void setBatteryLevel(int batteryLevel) {
        this.batteryLevel = batteryLevel;
    }

    public int getMobileNetworkType() {
        return this.mobileNetworkType;
    }

    public void setMobileNetworkType(int mobileNetworkType) {
        this.mobileNetworkType = mobileNetworkType;
    }

    public String getMobileNetworkStr() {
        return this.mobileNetworkStr;
    }

    public void setMobileNetworkStr(String mobileNetworkStr) {
        this.mobileNetworkStr = mobileNetworkStr;
    }

    public float getEmptyGbSize() {
        return this.emptyGbSize;
    }

    public void setEmptyGbSize(float emptyGbSize) {
        this.emptyGbSize = emptyGbSize;
    }

    public int getMobileSignalStrength() {
        return this.mobileSignalStrength;
    }

    public void setMobileSignalStrength(int mobileSignalStrength) {
        this.mobileSignalStrength = mobileSignalStrength;
    }

    public int getWifiSignalLevel() {
        return this.wifiSignalLevel;
    }

    public void setWifiSignalLevel(int wifiSignalLevel) {
        this.wifiSignalLevel = wifiSignalLevel;
    }

    public boolean isLocked() {
        return this.isLocked;
    }

    public void setLocked(boolean isLocked) {
        this.isLocked = isLocked;
    }

    public boolean isUVCCameraIn() {
        return this.isUVCCameraIn;
    }

    public void setUVCCameraIn(boolean isUVCCameraIn) {
        this.isUVCCameraIn = isUVCCameraIn;
    }

    public boolean isSilent() {
        return this.isSilent;
    }

    public void setSilent(boolean isSilent) {
        this.isSilent = isSilent;
    }

    public boolean isStorageAbnormal() {
        return this.storageAbnormal;
    }

    public void setStorageAbnormal(boolean storageAbnormal) {
        this.storageAbnormal = storageAbnormal;
    }

    public boolean isScreenOn() {
        return this.screenOn;
    }

    public void setScreenOn(boolean screenOn) {
        this.screenOn = screenOn;
    }

    public boolean isLongWorkMode() {
        return this.longWorkMode;
    }

    public void setLongWorkMode(boolean longWorkMode) {
        this.longWorkMode = longWorkMode;
    }

    public static void setInstance(ZFYStatus zFYStatus) {
        instance = zFYStatus;
    }

    public boolean isGpsReady() {
        return this.gpsReady;
    }

    public void setGpsReady(boolean gpsReady) {
        this.gpsReady = gpsReady;
    }

    public void setBatteryin(boolean batteryin) {
        this.batteryin = batteryin;
    }

    public boolean isLowTemperatureMode() {
        return this.isLowTemperatureMode;
    }

    public void setLowTemperatureMode(boolean isLowTemperatureMode) {
        this.isLowTemperatureMode = isLowTemperatureMode;
    }

    public boolean isHeightTemperatureMode() {
        return this.isHeightTemperatureMode;
    }

    public void setHeightTemperatureMode(boolean isHeightTemperatureMode) {
        this.isHeightTemperatureMode = isHeightTemperatureMode;
    }

    public boolean isOpenBle() {
        return this.openBle;
    }

    public void setOpenBle(boolean openBle) {
        this.openBle = openBle;
    }

    public boolean isUsbconnect() {
        return this.usbconnect;
    }

    public void setUsbconnect(boolean usbconnect) {
        this.usbconnect = usbconnect;
    }

    public int getAirplaneState() {
        return this.airplaneState;
    }

    public void setAirplaneState(int airplaneState) {
        this.airplaneState = airplaneState;
    }

    public boolean isBdOnly() {
        return this.bdOnly;
    }

    public void setBdOnly(boolean bdOnly) {
        this.bdOnly = bdOnly;
    }

    public boolean isUsbMassStorage() {
        return this.usbMassStorage;
    }

    public void setUsbMassStorage(boolean usbMassStorage) {
        this.usbMassStorage = usbMassStorage;
    }

    public boolean isDeviceLocked() {
        return this.deviceLocked;
    }

    public void setDeviceLocked(boolean deviceLocked) {
        this.deviceLocked = deviceLocked;
    }

    public int getWifiVersion() {
        return this.wifiVersion;
    }

    public void setWifiVersion(int wifiVersion) {
        this.wifiVersion = wifiVersion;
    }
}
